using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class CstctrMap : EntityTypeConfiguration<Cstctr>
    {
        public CstctrMap()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.DESC)
                .HasMaxLength(50);

            this.Property(t => t.CSTCTR1)
                .IsRequired()
                .HasMaxLength(9);

            this.Property(t => t.File_Primary_Key)
                .HasMaxLength(10);

            this.Property(t => t.subdatabase)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Cstctr");
            this.Property(t => t.DESC).HasColumnName("DESC");
            this.Property(t => t.CSTCTR1).HasColumnName("CSTCTR");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.File_Primary_Key).HasColumnName("File Primary Key");
            this.Property(t => t.HeaderCstCtr).HasColumnName("HeaderCstCtr");
            this.Property(t => t.isdefault).HasColumnName("isdefault");
            this.Property(t => t.subdatabase).HasColumnName("subdatabase");
        }
    }
}
